﻿Imports sstools.GenericExcelExporter

<ExportEntity(WorksheetName:="Deneme", BackgroundColor:="Red", HAlign:=XlHAlign.xlHAlignRight, VAlign:=XlVAlign.xlVAlignTop,
    BorderColor:="#EEEEEE")>
Public Class Personel
    <ExportMember(Order:=1, ColumnName:="Adı Soyadı", backgroundcolor:="#EEFF99",
        BorderWeight:=XlBorderWeight.xlThin, BorderLineStyle:=XlLineStyle.xlContinuous, BorderColor:="Black")>
    Property AdiSoyadi As String

    <ExportMember(Order:=4, ColumnName:="Eposta", HAlign:=XlHAlign.xlHAlignRight)>
    Property Email As String

    <ExportMember(Order:=5, ColumnName:="Telefon")>
    Property Telefon As String

    <ExportMember(Order:=2, ColumnName:="Doğum Tarihi", ValueFormatterFuncName:="DateFormatter")>
    Property DogumTarihi As Date

    <ExportMember(Order:=3, ColumnName:="Adres Bilgisi", BackgroundColor:="#EEFF99",
        BorderWeight:=XlBorderWeight.xlThin, BorderLineStyle:=XlLineStyle.xlContinuous, BorderColor:="Black",
        HAlign:=XlHAlign.xlHAlignRight)>
    Property Adres As New AdresBilgisi

    Public Shared Function DateFormatter(inp As Date) As String
        Return inp.ToString("yyyy-MM-dd")
    End Function
End Class


Public Class AdresBilgisi
    <ExportMember(Order:=3, ColumnName:="İlçesi")>
    Property Ilcesi As String

    <ExportMember(Order:=2, ColumnName:="Posta Kodu")>
    Property PostaKodu As String

    <ExportMember(Order:=1, ColumnName:="Şehir")>
    Property Sehir As New SehirBilgisi

End Class

Public Class SehirBilgisi
    <ExportMember(Order:=1, ColumnName:="Şehir Adı")>
    Property Sehir As String

    <ExportMember(Order:=2, ColumnName:="Ülke Kodu", HAlign:=XlHAlign.xlHAlignRight)>
    Property UlkeKodu As String

    <ExportMember(Order:=3, ColumnName:="Bölgesi")>
    Property Bolge As New BolgeBilgisi

End Class

Public Class BolgeBilgisi
    <ExportMember(Order:=1, ColumnName:="Bölge Adı", BackgroundColor:="Green",
        BorderWeight:=XlBorderWeight.xlThin, BorderLineStyle:=XlLineStyle.xlDashDotDot, BorderColor:="Blue")>
    Property BolgeAdi As String

    <ExportMember(Order:=2, ColumnName:="Ülke Kodu")>
    Property UlkeKodu As String

End Class
